﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="ACM_BOOK_Bank.aspx.cs" Inherits="KPIS.GERP.GAMS.APP.App_UI.Forms.ACM_BOOK_Bank" %>

<asp:Content ID="Content2" runat="server" contentplaceholderid="head">
    <title>สมุดเงินฝากธนาคาร</title>
    <link href="../CssClass.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Body" runat="server" contentplaceholderid="ContentPlaceHolder1" >
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
        
            function openWin(ControlName)
            {
                var oWnd = radopen("ACM_POPUP.aspx?ControlName=" + ControlName.id, "RadWindow1");
            }
            function OnClientClose(oWnd,args)
            {
                //get the transferred arguments
                var arg = args.get_argument();
                if(arg)
                { 
                    var account_seq = arg.account_seq;
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(account_seq);
                }
            }
            function OnTextChange(sender) {
                if (sender.get_value() == "") {
                    sender.set_text("");
                }
            }
            
        </script>
    </telerik:RadCodeBlock>

  <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" 
        OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Panel1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel1" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="Panel2" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="grdACMBookBank">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdACMBookBank" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="None" Skin="Outlook">
    </telerik:RadAjaxLoadingPanel>
    
     <div class="moduleContent1000">
           <div class="moduleDivBottom1000">
                 <asp:Panel ID="Panel2" runat="server" CssClass="contentPaneDiv" Height="30px" ScrollBars="Auto" >
                      <div class = "RHeader" align = "center">
                             <%--<fieldset style= "width:350px;height:25px;">
                                  สมุดเงินฝากธนาคาร
                             </fieldset>--%> 
                         </div>    
                             <table cellpadding="0" cellspacing="0" align = "right" >
                               <tr>
                                        <td><asp:Label ID="lblStatus" runat="server" Text="สถานะของข้อมูล" ForeColor="Orange" Font-Size="Large" Font-Bold="true"></asp:Label></td>
                                        <td width="100px" class="controls">
                                            <asp:LinkButton ID="btnSave" runat="server" CssClass="LinkButton" onclick="btnSave_Click" CausesValidation="true">
                                                <img alt="" id="imgSave" runat="server" src="~/App_UI/Images/Buttons/saveDisk.gif" title="บันทึกข้อมูล" width="17"/> บันทึกข้อมูล
                                            </asp:LinkButton>                                            
                                        </td>
                                        <td width="130px" class="controls">
                                            <asp:LinkButton ID="btnCancel" runat="server" CssClass="LinkButton" onclick="btnCancel_Click" CausesValidation="False">
                                                <img alt="" id="imgCancel" runat="server" src="~/App_UI/Images/Buttons/Cancel.gif" title="ยกเลิกการแก้ไข" width="17"/> ยกเลิกการแก้ไข
                                            </asp:LinkButton>
                                        </td>
                               </tr>
                            </table> 
                 </asp:Panel>
           </div>
     </div>          
     
     <div class="moduleContent1000">
              <div class="moduleDivBottom1000">
                 <asp:Panel ID="Panel1" runat="server" CssClass="contentPaneDiv" Height="530px" ScrollBars="Auto" align = "center" >    
                   <table>
                      <tr>
                         <td>
                             <telerik:RadGrid ID="grdACMBookBank" runat="server" AutoGenerateColumns="false"
                                                AllowMultiRowEdit="false" AllowMultiRowSelection="true" ShowStatusBar="true"
                                                Width="950px" Height="360px" AllowPaging="true" AllowFilteringByColumn="true"
                                                GroupingSettings-GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
                                                GroupingSettings-GroupContinuedFormatString=""
                                                GroupingSettings-GroupContinuesFormatString=""
                                                GroupingSettings-GroupSplitFormat=""
                                                OnNeedDataSource="grdACMBookBank_NeedDataSource" 
                                                OnItemCommand="grdACMBookBank_ItemCommand" align ="left">
                                                <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" GroupLoadMode="Client"
                                                    DataKeyNames="bank_acc_seq" NoMasterRecordsText="< ไม่มีข้อมูล >" GroupsDefaultExpanded="true">
                                                    <RowIndicatorColumn>
                                                        <HeaderStyle Width="20px" />
                                                    </RowIndicatorColumn>
                                                    <ExpandCollapseColumn>
                                                        <HeaderStyle Width="20px" />
                                                    </ExpandCollapseColumn>
                                                    <Columns>   
                                                        <telerik:GridTemplateColumn AllowFiltering="false" UniqueName="Edit" HeaderText="แก้ไข" HeaderStyle-Width="45px" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center"> 
                                                            <FilterTemplate></FilterTemplate>
                                                            <ItemTemplate>
                                                                &nbsp;&nbsp;&nbsp;
                                                                    <asp:ImageButton ID="cmdEdit" runat="server" CommandName="DataEdit"
                                                                        ImageUrl="~/App_UI/Images/Buttons/Edit.gif" 
                                                                        ToolTip="แก้ไขรายการ" width="17" />
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridBoundColumn DataField="bank_acc_seq" 
                                                            HeaderText="bank_acc_seq" UniqueName="bank_acc_seq"
                                                            FilterControlWidth="100%" AutoPostBackOnFilter="true" 
                                                            CurrentFilterFunction="Contains" ShowFilterIcon="false" Visible="false" 
                                                            HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="account_seq" 
                                                            HeaderText="account_seq" UniqueName="account_seq"
                                                            FilterControlWidth="100%" AutoPostBackOnFilter="true" 
                                                            CurrentFilterFunction="Contains" ShowFilterIcon="false" Visible="false" 
                                                            HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="bank_acc_no" 
                                                            HeaderText="เลขที่บัญชีเงินฝาก" UniqueName="bank_acc_no"
                                                            FilterControlWidth="100%" AutoPostBackOnFilter="true" AllowFiltering = "true"
                                                            HeaderStyle-Width="140px"
                                                            CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                            HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="bank_acc_name" 
                                                            HeaderText="ชื่อบัญชีเงินฝาก" UniqueName="bank_acc_name"
                                                            FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                            CurrentFilterFunction="Contains" ShowFilterIcon="false" 
                                                            HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                        </telerik:GridBoundColumn><%--HeaderStyle-Width="250px"--%>
                                                        <telerik:GridBoundColumn DataField="bank_name"
                                                            HeaderText="ชื่อธนาคาร" UniqueName="bank_name"
                                                            FilterControlWidth="100%" AutoPostBackOnFilter="true" HeaderStyle-Width="250px"
                                                            CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="account_code_name"
                                                            HeaderText="รหัสบัญชีเงินฝาก" UniqueName="account_code_name"
                                                            FilterControlWidth="100%" AutoPostBackOnFilter="true" HeaderStyle-Width="250px"
                                                            CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                        </telerik:GridBoundColumn>
                                                    </Columns>
                                                    <PagerStyle Mode="NumericPages" AlwaysVisible="true" 
                                                        FirstPageToolTip="กลับหน้าแรก" LastPageToolTip="ไปหน้าสุดท้าย" 
                                                        NextPagesToolTip="หน้าถัดไป" NextPageToolTip="หน้าถัดไป" 
                                                        PrevPagesToolTip="ย้อนกลับ" PrevPageToolTip="ย้อนกลับ" />
                                                    </MasterTableView>
                                        <GroupingSettings GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;" 
                                            GroupContinuedFormatString="" GroupContinuesFormatString="" 
                                            GroupSplitFormat="" />
                                        <ClientSettings EnableRowHoverStyle="True">
                                            <Selecting AllowRowSelect="true" />
                                            <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                                        </ClientSettings>
                                            </telerik:RadGrid> 
                         </td>
                      </tr>
                      <tr>
                         <td>
                             <fieldset style="width:926px;" >
                              <legend>แก้ไขรายการ</legend>
                                <table align ="left" >
                                   <tr>
                                      <td colspan="110" rowspan="22"></td>
                                   </tr>
                                   <tr>
                                      <td align="left"><asp:Label runat="server" ID="lblBookBankNo" Text ="เลขที่บัญชีเงินฝาก :" Font-Bold="true"/>
                                      </td>
                                      <td align="left"><telerik:RadTextBox ID="txtBookBankNo" runat="server" title="เลขที่บัญชีเงินฝาก" Width="350" Enabled="false"></telerik:RadTextBox>
                                      </td>
                                   </tr> 
                                   <tr>
                                      <td align="left"><asp:Label runat="server" ID="lblBookBankName" Text ="ชื่อบัญชีเงินฝาก :" Font-Bold="true"/>
                                      </td>
                                      <td align="left"><telerik:RadTextBox ID="txtBookBankName" runat="server" title="ชื่อบัญชีเงินฝาก" Width="350" Enabled="false"></telerik:RadTextBox>
                                      </td>
                                   </tr>  
                                   <tr>
                                      <td align="left"><asp:Label runat="server" ID="lblBankName" Text ="ธนาคาร :" Font-Bold="true"/>
                                      </td>
                                      <td align="left"><telerik:RadTextBox ID="txtBankName" runat="server" title="ธนาคาร" Width="350" Enabled="false"></telerik:RadTextBox>
                                      </td>
                                   </tr>  
                                   <tr>
                                      <td align="left"><asp:Label runat="server" ID="lblAccountCode" Text ="รหัสบัญชีสินทรัพย์ :" Font-Bold="true"/>
                                      </td>
                                      <td align="left">
                                          <%--<telerik:RadComboBox ID="cmbAccountCode" Runat="server"  
                                                    DataTextField="account_code_name" DataValueField="account_seq" 
                                                    Filter="Contains" 
                                                    Width="350" Enabled="false">
                                          </telerik:RadComboBox>--%>
                                           <telerik:RadComboBox ID="cmbAccountCode" Runat="server"
                                                DataTextField="account_code_name" DataValueField="account_seq" 
                                                EnableLoadOnDemand="true" 
                                                ShowMoreResultsBox="true" EnableVirtualScrolling="true"
                                                EmptyMessage="< เลือกรายการรหัสบัญชี >" AllowCustomText="true" Filter="Contains"
                                                OnClientTextChange="OnTextChange"
                                                OnItemsRequested="cmbAccountCode_ItemsRequested" Width="350px" title="รหัสบัญชี">
                                          </telerik:RadComboBox>
                                          <span class="span">&nbsp;*</span>
                                      </td>
                                      <td>
                                          <asp:ImageButton ID="btnAccountSearch" runat="server" ImageUrl="~/App_UI/Images/Buttons/Search.png" Width="20px"/>
                                          <telerik:RadTextBox ID="txtAccountCode" runat="server" title="รหัสบัญชีสินทรัพย์" Width="50" Enabled="false" Visible="false"></telerik:RadTextBox>
                                          
                                           <%--<telerik:RadComboBox ID="ddlFilterJobsiteGFMIS" runat="server" Width="100%"
                                                            DataSource='<%# LoadDDLJobsiteGFMIS() %>'
                                                            DataTextField="job_site_gfmis" DataValueField="job_site_gfmis" AppendDataBoundItems="true" 
                                                            SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("job_site_gfmis").CurrentFilterValue %>'
                                                            OnClientSelectedIndexChanged="IndexChanged"
                                                            EmptyMessage="< ทั้งหมด >" AllowCustomText="true" Filter="Contains"
                                                            OnClientTextChange="OnTextChange1">
                                                </telerik:RadComboBox>--%>
                                          <asp:Label runat= "server" ID = "hbank_acc_seq" Visible ="false" />
                                          <%--<asp:Label runat= "server" ID = "hAccount_seq" Visible ="true" />--%>
                                      </td>
                                    </tr>  
                                </table>
                               </fieldset> 
                          </td>
                      </tr>
                    </table>
                 </asp:Panel>
              </div>
     </div>
     <telerik:RadWindowManager ID="RadWindowManager1" VisibleStatusbar="false" ReloadOnShow="true"
        runat="server" Skin="Vista">
        <Windows>
            <telerik:RadWindow runat="server" ID="RadWindow1"
                Width="639px" Height="625px"  Skin="Outlook" 
                VisibleStatusbar="true"
                OnClientClose="OnClientClose">
            </telerik:RadWindow> <%--OnClientResize="SetWindowBehavior"--%>
        </Windows>
    </telerik:RadWindowManager>
</asp:Content>